import 'react-app-polyfill/ie11';
import 'react-app-polyfill/stable';
import React from 'react';
import ReactDOM from 'react-dom';
import { isInMicro, getMountNode, registerAppEnter, registerAppLeave } from '@pare/micro';

import App from './app/index';

console.log(isInMicro());

if (isInMicro()) {
  registerAppEnter(history => {
    ReactDOM.render(<App history={history} />, getMountNode());
  });
  registerAppLeave(() => {
    ReactDOM.unmountComponentAtNode(getMountNode());
  });
} else {
  ReactDOM.render(<App />, document.getElementById('root'));
}
